package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity(name = "Branch")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class BranchEntity implements Serializable {

    private static long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public static void setSerialVersionUID(long aSerialVersionUID) {
        serialVersionUID = aSerialVersionUID;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String branchName;
    private String contactNumber;
    private String contactPerson;
    private String emailAddress;
    //T32
    private int billingDay;
    
    @OneToOne(cascade={CascadeType.ALL}, orphanRemoval=true)
    private AddressEntity branchAddress;
    @ManyToOne
    private StakeholderEntity stakeholder;
    
    @OneToMany(cascade = {CascadeType.ALL}, orphanRemoval=true, mappedBy = "branch")
    private List<OperatingHoursEntity> operatingHours = new ArrayList<OperatingHoursEntity>();
    
    @OneToMany(cascade = {CascadeType.ALL}, orphanRemoval=true, mappedBy = "branch")
    private List<ExtendedOperatingHoursEntity> extendedOperatingHours = new ArrayList<ExtendedOperatingHoursEntity>();
    
    @OneToMany(cascade = {CascadeType.ALL}, orphanRemoval=true, mappedBy = "branch")
    private Set<OperatingHoursRemarksEntity> operatingHoursRemarks = new HashSet<OperatingHoursRemarksEntity>();
    
    //T32
    @OneToMany(mappedBy = "branch")
    private List<PackagePurchasedEntity> packagePurchased = new ArrayList<PackagePurchasedEntity>();
    @OneToMany(mappedBy = "branch")
    private List<ProductEntity> product = new ArrayList<ProductEntity>();
    @OneToMany(mappedBy = "branch")
    private List<RedemptionItemEntity> redemptionItem = new ArrayList<RedemptionItemEntity>();
    @OneToMany(mappedBy = "branch")
    private List<ReservationEntity> reservation = new ArrayList<ReservationEntity>();

    public BranchEntity() {
    }

    public BranchEntity(String branchName, String contactNumber, String contactPerson, String emailAddress) {
        this.branchName = branchName;
        this.contactNumber = contactNumber;
        this.contactPerson = contactPerson;
        this.emailAddress= emailAddress;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }

    public int getBillingDay() {
        return billingDay;
    }

    public void setBillingDay(int billingDay) {
        this.billingDay = billingDay;
    }

    public AddressEntity getBranchAddress() {
        return branchAddress;
    }

    public void setBranchAddress(AddressEntity branchAddress) {
        this.branchAddress = branchAddress;
    }

    public StakeholderEntity getStakeholder() {
        return stakeholder;
    }

    public void setStakeholder(StakeholderEntity stakeholder) {
        this.stakeholder = stakeholder;
    }

    public List<OperatingHoursEntity> getOperatingHours() {
        return operatingHours;
    }

    public void setOperatingHours(List<OperatingHoursEntity> operatingHours) {
        this.operatingHours = operatingHours;
    }

    public List<ExtendedOperatingHoursEntity> getExtendedOperatingHours() {
        return extendedOperatingHours;
    }

    public void setExtendedOperatingHours(List<ExtendedOperatingHoursEntity> extendedOperatingHours) {
        this.extendedOperatingHours = extendedOperatingHours;
    }

    public Set<OperatingHoursRemarksEntity> getOperatingHoursRemarks() {
        return operatingHoursRemarks;
    }

    public void setOperatingHoursRemarks(Set<OperatingHoursRemarksEntity> operatingHoursRemarks) {
        this.operatingHoursRemarks = operatingHoursRemarks;
    }

    public List<PackagePurchasedEntity> getPackagePurchased() {
        return packagePurchased;
    }

    public void setPackagePurchased(List<PackagePurchasedEntity> packagePurchased) {
        this.packagePurchased = packagePurchased;
    }

    public List<ProductEntity> getProduct() {
        return product;
    }

    public void setProduct(List<ProductEntity> product) {
        this.product = product;
    }

    public List<RedemptionItemEntity> getRedemptionItem() {
        return redemptionItem;
    }

    public void setRedemptionItem(List<RedemptionItemEntity> redemptionItem) {
        this.redemptionItem = redemptionItem;
    }

    public List<ReservationEntity> getReservation() {
        return reservation;
    }

    public void setReservation(List<ReservationEntity> reservation) {
        this.reservation = reservation;
    }

    
}